// TriangulatorTest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

using namespace Triangulator;

bool Test1()
{
	/*
	3--------2
	I        I
	I        I
	I        I
	0--------1
	*/
	Polygon polygon;
	polygon.push_back(vertex(0, 0));
	polygon.push_back(vertex(1, 0));
	polygon.push_back(vertex(1, 1));
	polygon.push_back(vertex(0, 1));
	Triangles triangs = Triangulate(polygon);
	return triangs.size() == 2;
}

bool Test2()
{
	/*
	4-------3
	I      /
	I     /
	I    2
	I     \
	I      \
	0-------1
	*/
	Polygon polygon;
	polygon.push_back(vertex(-1, -1));
	polygon.push_back(vertex(1, -1));
	polygon.push_back(vertex(0, 0));
	polygon.push_back(vertex(1, 1));
	polygon.push_back(vertex(-1, 1));
	Triangles triangs = Triangulate(polygon);
	return triangs.size() == 3;
}

int _tmain(int argc, _TCHAR* argv[])
{
	if (!Test1())
	{
		return 1;
	}
	if (!Test2())
	{
		return 1;
	}
	return 0;
}
